package com.pet.server.po;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Formula;

/**
 * TaskInfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "user_task_daily")
public class UserTaskDaily implements java.io.Serializable {

	
	// Fields

	private Integer id;
	private Integer userId;
	private String nickName;
	private String taskId;
	private String taskName;
	private String state;
	//完成次数
	private Integer time;
	//是否领取
	private Integer received;
	private Date createDate;
	

	// Constructors

	/** default constructor */
	public UserTaskDaily() {
	}

	/** full constructor */
	public UserTaskDaily(Integer id, Integer userId, String taskId,
			String taskName, Integer time, Integer received, Date createDate) {
		super();
		this.id = id;
		this.userId = userId;
		this.taskId = taskId;
		this.taskName = taskName;
		this.time = time;
		this.received = received;
		this.createDate = createDate;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "task_id", nullable = false, length = 20)
	public String getTaskId() {
		return this.taskId;
	}

	public void setTaskId(String taskId) {
		this.taskId = taskId;
	}

	@Formula("(SELECT f.task_name FROM task_info f WHERE f.task_id=task_id)")
	public String getTaskName() {
		return this.taskName;
	}

	public void setTaskName(String taskName) {
		this.taskName = taskName;
	}

	@Column(name = "user_id", unique = true, nullable = false)
	public Integer getUserId() {
		return userId;
	}

	
	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	@Column(name = "time", length = 32)
	public Integer getTime() {
		return time;
	}

	
	public void setTime(Integer time) {
		this.time = time;
	}

	@Column(name = "received", length = 32)
	public Integer getReceived() {
		return received;
	}

	
	public void setReceived(Integer received) {
		this.received = received;
	}

	@Column(name = "create_date", nullable = false, length = 0)
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Formula("(SELECT f.nick_name FROM user_info f WHERE f.user_id=user_id)")
	public String getNickName() {
		return nickName;
	}

	
	public void setNickName(String nickName) {
		this.nickName = nickName;
	}
	
	/**
	 * @return the state
	 */
	@Column(name = "state", nullable = false, length = 32)
	public String getState() {
		return state;
	}


	/**
	 * @param state the state to set
	 */
	public void setState(String state) {
		this.state = state;
	}
}